package com.nand.blockdemo.adapter;

import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.nand.blockdemo.R;
import com.nand.blockdemo.bean.MenuBean;

import java.util.List;

public class MenuAdapter extends BaseQuickAdapter<MenuBean, BaseViewHolder> {


    public MenuAdapter(int layoutResId, @Nullable List<MenuBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MenuBean item) {
        helper.setText(R.id.text, item.getTitle());
        TextView text = helper.getView(R.id.text);
        if (item.isSelect()) {
            text.setTextColor(mContext.getResources().getColor(R.color.blue));
        }else {
            text.setTextColor(mContext.getResources().getColor(R.color.gray_text));
        }
    }
}
